﻿using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using QLDAOL.ModelView;
using System.Web;
using System.Collections;

namespace QLDAOL.Models
{
    public interface IQLDAOLRepository
    {

        void addUser(USER newUser);
        USER ValidateUser(string loginName, string password);
        USER getUserByUsername(string user_name);

        USER getUserByUserid(int user_id);
        IEnumerable<PROJECT_SUPPORTER> getlstSupporter(int PjID);

        #region danhmuc
         IEnumerable<DM_PROJECT_LANGUAGE> getlstProjectLang();
         //IEnumerable<PROJECT> getlstProject();
         //IEnumerable<PROJECT> getlstProjectResult();
        #endregion

        #region project
         IEnumerable<PROJECT> getlstPJSearch(string pjName, int pjLag);
         bool checkPJAccess(int pjID, int userID);
        #endregion 

        #region user
         IEnumerable<USER> getlstUserByPJID(int pjID);
         IEnumerable<USER> getlstUserOnlineByPJID(int pjID);
         IEnumerable<USER> getlst6UserByPJID(int pjID);
         IEnumerable<USER_PROJECT_ROLE> getlstUserRoleByPJID(int pjID);
         void addUserProject(string email, int role, int id);
        #endregion

        #region news_QA
         IEnumerable<NEWS_QUESTIONS> getlstLatestNewsQA(int type, int ID_PJ);
         IEnumerable<NEWS_QUESTIONS> getlstNewsQA(int type, int ID_PJ);
         NEWS_QUESTIONS getInfoByID(int id);
         void addNewsQA(NEWS_QUESTIONS n);
         void delNewsQA(int id);
        #endregion

        #region task
         IEnumerable<DIVISION_TASK> getlstLatestTask(int ID_PJ);
         IEnumerable<DIVISION_TASK> getlstTask(int ID_PJ);
         IEnumerable<DIVISION_TASK> getAllTaskByUSer(int id_user);
         IEnumerable<DIVISION_TASK> getAllTaskByUSer_PJ(int id_user, int ID_PJ);
         void addTask(string task,int userid,string start,string dead,int id,int status);
         void editTask(int taskID, string task, int userid, string start, string dead, int id, int status);
         DIVISION_TASK gettask(int taskID);
         IEnumerable<DM_State> getlstTaskState();
         IEnumerable<DIVISION_TASK> getlstTask(int userid, int ID_PJ);
        #endregion

         #region Danhmuc
         IEnumerable<DM_ROLE> getlstPJRole();
         #endregion
         void temp();

        #region mail
        IEnumerable<MAIL> getMailByUser(int id);
        IEnumerable<MAIL> getSentMailByUser(int id);
        MAIL getMailByMailid(int Mail_id);
        void addMail(MAIL newMail);
        int getUserId(string username);
        #endregion
        #region Download
       
        IEnumerable<DOWNLOAD> getAllDownload(int pjid);
        DOWNLOAD getDownloadById(int id);
        void deletedownload(DOWNLOAD del);
        IEnumerable<DOWNLOAD> getAllDownloadbyuser(string  username);
        #endregion
        #region chat
        void addchat(PJ_CHAT newChat);
        IEnumerable<PJ_CHAT> getchatbyPjID(int PjID);
        #endregion
        #region PJCalendar
        IEnumerable<PJ_CALENDAR> getAllPJCalendar(int pjid);
        void insertPjCalendar(PJ_CALENDAR P);
        void deletePjCalendar(PJ_CALENDAR P);
        void UpdatePjCalendar(PJ_CALENDAR P);
        PJ_CALENDAR getPjCalendarByID(int id);
        void inserttopjuser(int pjid, PJ_CALENDAR P);
        void updatetopjuser(int pjid, PJ_CALENDAR P);
        void deletetopjuser(int pjid, PJ_CALENDAR P);
        #endregion
        #region userCalendar
        IEnumerable<USER_CALENDAR> getAllUserCalendar(int userid);
        void insertUserCalendar(USER_CALENDAR P);
        void deleteUserCalendar(USER_CALENDAR P);
        void UpdateUserCalendar(USER_CALENDAR P);
        USER_CALENDAR getUserCalendarByID(int id);
        IEnumerable<USER_CALENDAR> getUserCalendarByPjCalendarId(int id);
        #endregion
        #region user_project_role

        IEnumerable<USER_PROJECT_ROLE> getuserpjrolebypjid(int pjid);
        bool ispm(int pjid, int userid);
        #endregion
    }

    
}